const http = require('http');

http.createServer((req, res) => {
    const query = new URL(req.url, `http://${req.headers.host}`).searchParams

    if (query.get('cb')) {
        const cb = query.get('cb')  // 'callback'
        const data = 'hello world'
        const result = `${cb}("${data}")`   // "callback('hello world')"
        res.end(result)
    }


}).listen(3000);